package com.gxks.lhs.controller.user;

import com.gxks.lhs.constants.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Api(tags = "通用接口")
@Slf4j
@RestController
@RequestMapping("/restful-api")
public class CommonContrller {
    @ApiOperation("获取主页轮播图")
    @GetMapping("/indexImgs")
    public R addCategory() {
        String str = null;
        Map map = new HashMap<String, String>();
//        map.put("imgUrl", "https://img.mall4j.com/2019/04/c2d830afc56d469f96825e91e464d155.jpg");
        map.put("imgUrl", "http://localhost:8080/img/7b12446a-df07-4911-a53f-2ed43d74b547.jpg");
        map.put("seq", 10);
        map.put("uploadTime", "2019-04-22 09:57:34");
        map.put("type", 0);
        map.put("relation", 76);
        Map map2 = new HashMap<String, String>();
//        map2.put("imgUrl", "https://img.mall4j.com/2019/04/c2d830afc56d469f96825e91e464d155.jpg");
        map2.put("imgUrl", "http://localhost:8080/img/97c8c64f-d60e-4f60-a57b-5f5ecf2ff5fa.jpg");
        map2.put("seq", 120);
        map2.put("uploadTime", "2019-04-22 09:57:34");
        map2.put("type", 0);
        map2.put("relation", 73);
        List<Map> list = new ArrayList<>();
        list.add(map);
        list.add(map2);
//        str = list.toString();
        return R.success(list);
    }
}
